package org.suyafei.service;

import org.suyafei.cotroller.request.ConfirmOrderRequest;
import org.suyafei.cotroller.request.ProductOrderPageRequest;
import org.suyafei.enums.ProductOrderPayTypeEnum;
import org.suyafei.model.EventMessage;
import org.suyafei.utils.JsonData;

import java.util.Map;

/**
 * @author 宿某人
 * @Date: 2022/02/06/4:04 下午
 * @Description:
 */
public interface ProductOrderService {
    /**
     * 分页查询订单
     * @param request
     * @return
     */
    Map<String, Object> page(ProductOrderPageRequest request);

    /**
     * 查询订单状态
     * @param outTradeNo
     * @return
     */
    String queryProductOrderState(String outTradeNo);

    /**
     * 提交订单
     * @param orderRequest
     * @return
     */
    JsonData confirmOrder(ConfirmOrderRequest orderRequest);

    /**
     * 关闭订单
     * @param eventMessage
     * @return
     */
    boolean closeProductOrder(EventMessage eventMessage);

    /**
     * 处理微信回调通知
     * @param wechatPay
     * @param paramsMap
     */
    JsonData processOrderCallbackMsg(ProductOrderPayTypeEnum wechatPay, Map<String, String> paramsMap);

    /**
     * 处理订单队列消息
     * @param eventMessage
     */
    void handleProductOderMessage(EventMessage eventMessage);
}
